package com.onlineClass.edu.service.impl;

import com.onlineClass.edu.entity.UserLoginLog;
import com.onlineClass.edu.mapper.UserLoginLogMapper;
import com.onlineClass.edu.service.IUserLoginLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author denghui
 * @since 2024-05-03
 */
@Service
@Slf4j
public class UserLoginLogServiceImpl extends ServiceImpl<UserLoginLogMapper, UserLoginLog> implements IUserLoginLogService {
@Autowired
private UserLoginLogMapper mapper;

    @Async("newSaskExecutor")//源码会一直new线程，需要和自定义配置的县城池一起使用 指定的线程池：newSaskExecutor
    @Transactional//插入操作回滚？
    @Override
    public void insert(UserLoginLog userLoginLog) {
        int insertResult = mapper.insert(userLoginLog);
        log.info("[插入数据：insertResult:{}]", insertResult);
    }
}
